+Wed Apr 18 14:23:14 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkimage-x11.c (gdk_image_new): Try changing
+ mode on shm segments to 0600. We'll see who complains.
+
+ * gdk/gdkwindow.c (_gdk_window_destroy_hierarchy): Call
+ _gdk_windowing_window_destroy() AFTER recursing through
+ children.
+
+ * tests/Makefile.am (noinst_PROGRAMS): Build testsocket,
+ testsocket_child on X.
+
+ * tests/testsocket[_child].c: Fix uses of
+ gtk_window_get_default_accel_group().
+
+ [ Merge patch from Ramiro Estrugo <ramiro@eazel.com> from gtk-1-2 ]
+
+ * gdk/gdkimage.c: (gdk_image_get):
+ Deal with the possibility that XGetImage() might return NULL.
+ Allocate the GdkImagePrivate structure only after XGetImage()
+ succeeds in order not to dereference a NULL ximage pointer. This
+ prevents a core dump when XGetImage() fails - which is unlikely,
+ but can happen due to race conditions accessing the geometries of
+ drawables. An x error will still be triggered, but the gdk image
+ wrapper at least wont seg fault.
+
2001-04-18 Havoc Pennington <hp@redhat.com>
* gtk/gtkimage.c: fix to properly queue resizes when the image is
+Wed Apr 18 14:23:14 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkimage-x11.c (gdk_image_new): Try changing
+ mode on shm segments to 0600. We'll see who complains.
+
+ * gdk/gdkwindow.c (_gdk_window_destroy_hierarchy): Call
+ _gdk_windowing_window_destroy() AFTER recursing through
+ children.
+
+ * tests/Makefile.am (noinst_PROGRAMS): Build testsocket,
+ testsocket_child on X.
+
+ * tests/testsocket[_child].c: Fix uses of
+ gtk_window_get_default_accel_group().
+
+ [ Merge patch from Ramiro Estrugo <ramiro@eazel.com> from gtk-1-2 ]
+
+ * gdk/gdkimage.c: (gdk_image_get):
+ Deal with the possibility that XGetImage() might return NULL.
+ Allocate the GdkImagePrivate structure only after XGetImage()
+ succeeds in order not to dereference a NULL ximage pointer. This
+ prevents a core dump when XGetImage() fails - which is unlikely,
+ but can happen due to race conditions accessing the geometries of
+ drawables. An x error will still be triggered, but the gdk image
+ wrapper at least wont seg fault.
+
2001-04-18 Havoc Pennington <hp@redhat.com>
* gtk/gtkimage.c: fix to properly queue resizes when the image is
+Wed Apr 18 14:23:14 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkimage-x11.c (gdk_image_new): Try changing
+ mode on shm segments to 0600. We'll see who complains.
+
+ * gdk/gdkwindow.c (_gdk_window_destroy_hierarchy): Call
+ _gdk_windowing_window_destroy() AFTER recursing through
+ children.
+
+ * tests/Makefile.am (noinst_PROGRAMS): Build testsocket,
+ testsocket_child on X.
+
+ * tests/testsocket[_child].c: Fix uses of
+ gtk_window_get_default_accel_group().
+
+ [ Merge patch from Ramiro Estrugo <ramiro@eazel.com> from gtk-1-2 ]
+
+ * gdk/gdkimage.c: (gdk_image_get):
+ Deal with the possibility that XGetImage() might return NULL.
+ Allocate the GdkImagePrivate structure only after XGetImage()
+ succeeds in order not to dereference a NULL ximage pointer. This
+ prevents a core dump when XGetImage() fails - which is unlikely,
+ but can happen due to race conditions accessing the geometries of
+ drawables. An x error will still be triggered, but the gdk image
+ wrapper at least wont seg fault.
+
2001-04-18 Havoc Pennington <hp@redhat.com>
* gtk/gtkimage.c: fix to properly queue resizes when the image is
+Wed Apr 18 14:23:14 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkimage-x11.c (gdk_image_new): Try changing
+ mode on shm segments to 0600. We'll see who complains.
+
+ * gdk/gdkwindow.c (_gdk_window_destroy_hierarchy): Call
+ _gdk_windowing_window_destroy() AFTER recursing through
+ children.
+
+ * tests/Makefile.am (noinst_PROGRAMS): Build testsocket,
+ testsocket_child on X.
+
+ * tests/testsocket[_child].c: Fix uses of
+ gtk_window_get_default_accel_group().
+
+ [ Merge patch from Ramiro Estrugo <ramiro@eazel.com> from gtk-1-2 ]
+
+ * gdk/gdkimage.c: (gdk_image_get):
+ Deal with the possibility that XGetImage() might return NULL.
+ Allocate the GdkImagePrivate structure only after XGetImage()
+ succeeds in order not to dereference a NULL ximage pointer. This
+ prevents a core dump when XGetImage() fails - which is unlikely,
+ but can happen due to race conditions accessing the geometries of
+ drawables. An x error will still be triggered, but the gdk image
+ wrapper at least wont seg fault.
+
2001-04-18 Havoc Pennington <hp@redhat.com>
* gtk/gtkimage.c: fix to properly queue resizes when the image is
+Wed Apr 18 14:23:14 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkimage-x11.c (gdk_image_new): Try changing
+ mode on shm segments to 0600. We'll see who complains.
+
+ * gdk/gdkwindow.c (_gdk_window_destroy_hierarchy): Call
+ _gdk_windowing_window_destroy() AFTER recursing through
+ children.
+
+ * tests/Makefile.am (noinst_PROGRAMS): Build testsocket,
+ testsocket_child on X.
+
+ * tests/testsocket[_child].c: Fix uses of
+ gtk_window_get_default_accel_group().
+
+ [ Merge patch from Ramiro Estrugo <ramiro@eazel.com> from gtk-1-2 ]
+
+ * gdk/gdkimage.c: (gdk_image_get):
+ Deal with the possibility that XGetImage() might return NULL.
+ Allocate the GdkImagePrivate structure only after XGetImage()
+ succeeds in order not to dereference a NULL ximage pointer. This
+ prevents a core dump when XGetImage() fails - which is unlikely,
+ but can happen due to race conditions accessing the geometries of
+ drawables. An x error will still be triggered, but the gdk image
+ wrapper at least wont seg fault.
+
2001-04-18 Havoc Pennington <hp@redhat.com>
* gtk/gtkimage.c: fix to properly queue resizes when the image is
+Wed Apr 18 14:23:14 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkimage-x11.c (gdk_image_new): Try changing
+ mode on shm segments to 0600. We'll see who complains.
+
+ * gdk/gdkwindow.c (_gdk_window_destroy_hierarchy): Call
+ _gdk_windowing_window_destroy() AFTER recursing through
+ children.
+
+ * tests/Makefile.am (noinst_PROGRAMS): Build testsocket,
+ testsocket_child on X.
+
+ * tests/testsocket[_child].c: Fix uses of
+ gtk_window_get_default_accel_group().
+
+ [ Merge patch from Ramiro Estrugo <ramiro@eazel.com> from gtk-1-2 ]
+
+ * gdk/gdkimage.c: (gdk_image_get):
+ Deal with the possibility that XGetImage() might return NULL.
+ Allocate the GdkImagePrivate structure only after XGetImage()
+ succeeds in order not to dereference a NULL ximage pointer. This
+ prevents a core dump when XGetImage() fails - which is unlikely,
+ but can happen due to race conditions accessing the geometries of
+ drawables. An x error will still be triggered, but the gdk image
+ wrapper at least wont seg fault.
+
2001-04-18 Havoc Pennington <hp@redhat.com>
* gtk/gtkimage.c: fix to properly queue resizes when the image is
+Wed Apr 18 14:23:14 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkimage-x11.c (gdk_image_new): Try changing
+ mode on shm segments to 0600. We'll see who complains.
+
+ * gdk/gdkwindow.c (_gdk_window_destroy_hierarchy): Call
+ _gdk_windowing_window_destroy() AFTER recursing through
+ children.
+
+ * tests/Makefile.am (noinst_PROGRAMS): Build testsocket,
+ testsocket_child on X.
+
+ * tests/testsocket[_child].c: Fix uses of
+ gtk_window_get_default_accel_group().
+
+ [ Merge patch from Ramiro Estrugo <ramiro@eazel.com> from gtk-1-2 ]
+
+ * gdk/gdkimage.c: (gdk_image_get):
+ Deal with the possibility that XGetImage() might return NULL.
+ Allocate the GdkImagePrivate structure only after XGetImage()
+ succeeds in order not to dereference a NULL ximage pointer. This
+ prevents a core dump when XGetImage() fails - which is unlikely,
+ but can happen due to race conditions accessing the geometries of
+ drawables. An x error will still be triggered, but the gdk image
+ wrapper at least wont seg fault.
+
2001-04-18 Havoc Pennington <hp@redhat.com>
* gtk/gtkimage.c: fix to properly queue resizes when the image is
private->state |= GDK_WINDOW_STATE_WITHDRAWN;
private->destroyed = TRUE;
- _gdk_windowing_window_destroy (window, recursing, foreign_destroy);
-
if (private->parent)
{
GdkWindowObject *parent_private = (GdkWindowObject *)private->parent;
g_list_free (children);
}
+ _gdk_windowing_window_destroy (window, recursing, foreign_destroy);
+
if (private->filters)
{
tmp = private->filters;
gboolean override_redirect;
};
-struct _GdkGeometry {
+struct _GdkGeometry
+{
gint min_width;
gint min_height;
gint max_width;
x_shm_info->shmid = shmget (IPC_PRIVATE,
private->ximage->bytes_per_line * private->ximage->height,
- IPC_CREAT | 0777);
+ IPC_CREAT | 0600);
if (x_shm_info->shmid == -1)
{
/* EINVAL indicates, most likely, that the segment we asked for
- * is bigger than SHMMAX, so we don't treat it as a permanently
- * fatal error. ENOSPC and ENOMEM may also indicate this, but
+ * is bigger than SHMMAX, so we don't treat it as a permanent
+ * error. ENOSPC and ENOMEM may also indicate this, but
* more likely are permanent errors.
*/
if (errno != EINVAL)
GdkImagePrivateX11 *private;
GdkDrawableImplX11 *impl;
GdkVisual *visual;
-
+ XImage *ximage;
+
g_return_val_if_fail (GDK_IS_DRAWABLE_IMPL_X11 (drawable), NULL);
visual = gdk_drawable_get_visual (drawable);
impl = GDK_DRAWABLE_IMPL_X11 (drawable);
+ ximage = XGetImage (impl->xdisplay,
+ impl->xid,
+ x, y, width, height,
+ AllPlanes, ZPixmap);
+
+ if (!ximage)
+ return NULL;
+
image = g_object_new (gdk_image_get_type (), NULL);
private = PRIVATE_DATA (image);
private->xdisplay = gdk_display;
- private->ximage = XGetImage (private->xdisplay,
- impl->xid,
- x, y, width, height,
- AllPlanes, ZPixmap);
+ private->ximage = ximage;
image->type = GDK_IMAGE_NORMAL;
image->visual = visual;
-lm \
@STRIP_END@
+if USE_X11
+testsocket_programs = testsocket testsocket_child
+endif
+
+
noinst_PROGRAMS = \
simple \
testcalendar \
testinput \
testrgb \
testselection \
-## testsocket \
-## testsocket_child \
+ $(testsocket_programs) \
testtext \
testtextbuffer \
testtreeview \
testtreesort \
treestoretest
-#testsocket_DEPENDENCIES = $(DEPS)
-#testsocket_child_DEPENDENCIES = $(DEPS)
simple_DEPENDENCIES = $(TEST_DEPS)
testcalendar_DEPENDENCIES = $(TEST_DEPS)
testdnd_DEPENDENCIES = $(TEST_DEPS)
testinput_DEPENDENCIES = $(TEST_DEPS)
testrgb_DEPENDENCIES = $(TEST_DEPS)
testselection_DEPENDENCIES = $(TEST_DEPS)
+testsocket_DEPENDENCIES = $(DEPS)
+testsocket_child_DEPENDENCIES = $(DEPS)
testtext_DEPENDENCIES = $(TEST_DEPS)
testtextbuffer_DEPENDENCIES = $(TEST_DEPS)
testtreeview_DEPENDENCIES = $(DEPS)
testtreesort_DEPENDENCIES = $(DEPS)
treestoretest_DEPENDENCIES = $(TEST_DEPS)
-#testsocket_LDADD = $(LDADDS)
-#testsocket_child_LDADD = $(LDADDS)
simple_LDADD = $(LDADDS)
testcalendar_LDADD = $(LDADDS)
testdnd_LDADD = $(LDADDS)
testinput_LDADD = $(LDADDS)
testrgb_LDADD = $(LDADDS)
testselection_LDADD = $(LDADDS)
+testsocket_LDADD = $(LDADDS)
+testsocket_child_LDADD = $(LDADDS)
testtextbuffer_LDADD = $(LDADDS)
testtreeview_LDADD = $(LDADDS)
testtreefocus_LDADD = $(LDADDS)
GtkWidget *button;
GtkWidget *hbox;
GtkWidget *entry;
+ GtkAccelGroup *accel_group;
GtkItemFactory *item_factory;
gtk_init (&argc, &argv);
vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (window), vbox);
- item_factory = gtk_item_factory_new (GTK_TYPE_MENU_BAR, "<main>",
- gtk_window_get_default_accel_group (GTK_WINDOW (window)));
+ accel_group = gtk_accel_group_new ();
+ gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
+ item_factory = gtk_item_factory_new (GTK_TYPE_MENU_BAR, "<main>", accel_group);
+
+
gtk_item_factory_create_items (item_factory,
G_N_ELEMENTS (menu_items), menu_items,
NULL);
GtkWidget *add_button;
GtkWidget *remove_button;
GtkWidget *toplevel = gtk_widget_get_toplevel (box);
- GtkAccelGroup *accel_group = gtk_window_get_default_accel_group (GTK_WINDOW (toplevel));
- add_button = gtk_button_new_accel ("_Add", accel_group);
+ add_button = gtk_button_new_with_mnemonic ("_Add");
gtk_box_pack_start (GTK_BOX (box), add_button, TRUE, TRUE, 0);
gtk_widget_show (add_button);
GTK_SIGNAL_FUNC (add_buttons),
box);
- remove_button = gtk_button_new_accel ("_Remove", accel_group);
+ remove_button = gtk_button_new_with_mnemonic ("_Remove");
gtk_box_pack_start (GTK_BOX (box), remove_button, TRUE, TRUE, 0);
gtk_widget_show (remove_button);
GtkWidget *hbox;
GtkWidget *entry;
GtkWidget *button;
- GtkAccelGroup *accel_group;
gtk_init (&argc, &argv);
if (argc < 2)
gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
gtk_widget_show (entry);
- accel_group = gtk_window_get_default_accel_group (GTK_WINDOW (window));
-
- button = gtk_button_new_accel ("_Close", accel_group);
+ button = gtk_button_new_with_mnemonic ("_Close");
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_widget_show (button);